#pragma once
#include <map>
#include <queue>
#include "NodePoint.h"


// 节点类
class CPoint {
public:
	//角点对象是一个循环链表结构
	NodePoint* m_pt_ptr = nullptr;		//指向寻路器对象中的的m_ptArr所指的对象内的点对象，该对象在data中定义
	CPoint* m_pt_left = nullptr;
	CPoint* m_pt_right = nullptr;
	NodePoint m_extent_direc;			//节点扩展方向
	int m_c_obsIndex = -1;

public:
	// 构造函数，初始化节点对象
	CPoint() {};
	CPoint(NodePoint* pt_ptr) : m_pt_ptr(pt_ptr) {};
	CPoint(NodePoint* pt_ptr, NodePoint extent_direc) : m_pt_ptr(pt_ptr), m_extent_direc(extent_direc) {};
};

struct Node {	// 树结构节点
	int m_node_n = -1;
	int m_parent_n = -1;
	std::vector<int> m_children;	//子节点，用二叉堆结构快速访问指定点对应的节点
	NodePoint* m_ptr = nullptr;
	int obsIndex = -1;
	Node(int pt_index, NodePoint* ptr_) : m_node_n(pt_index), m_ptr(ptr_) {};

	bool chosen = false;	//节点是否被路径选中
	double F = 0;
	double G = 0;
	double H = 0;


	// 小于运算符重载，用于节点比较
	bool operator<(const Node& other) const {
		return F < other.F;
	}
};

